#!/bin/bash
# 设置基本信息
version=v1.6.0
project_name=sqlstudio
namespace=levyy
docker_reg=registry.cn-hangzhou.aliyuncs.com
image_full_name=${project_name}:${version}

# 登录
docker login -u "$USERNAME" -p "$PASSWORD"  $docker_reg

# 构建镜像
docker build -t "${image_full_name}" -f Dockerfile .

# 构建失败报错
if [ $? != 0 ]; then
exit 1
fi

# 更新镜像
docker tag "${image_full_name}" "${docker_reg}/${namespace}/${image_full_name}"

# 推送镜像
docker push "${docker_reg}/${namespace}/${image_full_name}"
